package com.ffyc.backserver.dao;

import com.ffyc.backserver.model.Admin;
import com.ffyc.backserver.model.Menu;
import com.ffyc.backserver.model.Role;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AdminDao {


    List<Admin> findAdmin(Admin admin);

    List<Role> findRoles();

    /*向数据库管理员表中添加管理员*/
    void insertAdmin(Admin admin);

    void insertAdminRole(@Param("aid") Integer id, @Param("rid") int roleId);

    /*根据id查询admin*/
    Admin findAdminById(Integer id);

    /*根据id删除admin*/
    void deleteAdmin(Integer id);
    /*根据id删除adminrole关系*/
    void deleteAdmin_Role(Integer id);

    //更新管理员信息
    void updateAdmin(Admin admin);

    /*管理员头像上传*/
    void uploadImg(Admin admin);
}
